<?php

class Application_Form_Usuario extends Zend_Form
{

    public function init()
    {
    	$objPerfil = new Application_Model_Perfil();
    	$translator = Zend_Registry::get('translator');
    	
        $this->setName('form_usuario');
        $this->setAction('');
        $this->setMethod('post');
        
        $nome = new Zend_Form_Element_Text('nome');
        $nome->setLabel('Nome:');
        $nome->setAttribs(array('size'=>'50'));
        //$nome->addFilter(new Zend_Filter_StringToUpper());
        $nome->setRequired(true);
        
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email:');
        $email->setAttribs(array('size'=>'50'));
        $email->addValidator(new Zend_Validate_EmailAddress());
        $email->setRequired(true);
        
        
        $login = new Zend_Form_Element_Text('login');
        $login->setLabel('Login:');
        $login->setAttribs(array('size'=>'21',' MAXLENGTH'=>'20'));
        //$login->addFilter(new Zend_Filter_StringToUpper());
        $login->setRequired(true);
        
        $senha = new Zend_Form_Element_Password('senha');
        $senha->setLabel('Senha:');
        $senha->setAttribs(array('size'=>'10'));
        $senha->setRequired(true);
        
        $criar = new Zend_Form_Element_Submit('salvar');
        $criar->setAttribs(array('title'=>'Salvar', 'style'=>'font-weight:bold;'));    
       
        $perfil = new Zend_Form_Element_Select('idperfil');
        $perfil->setLabel('Perfil:');
        $dados = $objPerfil->fetchPair();
        $perfil->addMultiOptions($dados);
        
        $this->addElements(array($nome,$email,$login,$senha,$perfil,$criar));
    }


}

